package com.curso.sesion9;

import java.io.File;
import java.io.IOException;


class OpsFile {
	public static void main(String [] args) {
		try {                      // warning: exceptions possible
			boolean newFile = false;
			File file = new File  ("C:\\computer\\fileWritel.txt");          // it's only an object
			System.out.println("" + file.getAbsolutePath());
			System.out.println("" + file.getCanonicalPath());
			System.out.println("" + file.getPath());
			System.out.println("" + file.getParent());
			
			
			
			System.out.println(file.exists());  // look for a real file
		
			
			
			File dir = new File  ("C:\\computer\\");          // it's only an object
			System.out.println("" + dir.getAbsolutePath());
			System.out.println("" + dir.getCanonicalPath());
			System.out.println("" + dir.getPath());

		newFile = file.createNewFile();     // maybe create a file!
			System.out.println(newFile);        // already there?
			System.out.println(file.exists());  // look again }
		} catch(IOException e) { 
			e.printStackTrace();
		}
	}
}
